package com.quectel.aiot.config;

import com.quec.client.MgrClient;
import com.quec.config.InitClientProfile;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class QueCloudConfig {

    @Value("${quecloud.sdk.access-key}")
    private String accessKey;

    @Value("${quecloud.sdk.access-secret}")
    private String accessSecret;

    @Value("${quecloud.sdk.endpoint}")
    private String endpoint;

    @Bean
    public MgrClient mgrClient() {
        InitClientProfile initClientProfile = new InitClientProfile(
            accessKey,
            accessSecret,
            endpoint
        );
        return new MgrClient(initClientProfile);
    }

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
} 